{% extends 'base.html' %}

{% block title %}
<title>登录-todo.NUTURE</title>
<link rel="stylesheet" href="static/css/login.css" type="text/css">
{% endblock %}

{% block body %}
<section class="h-100">
    <div class="container h-100">
        <div class="row justify-content-md-center h-100">
            <div class="card-wrapper">
                <div class="brand"><!--logo-->
                    <img src="static/images/logo.svg" alt="logo">
                </div>
                <div class="card fat">
                    <div class="card-body">
                        <h4 class="card-title">登录</h4>
                        <form method="POST" class="my-login-validation" onsubmit="return check()"><!--使用js检查输入是否合法-->
                            <div class="form-group">
                                <label for="username">用户名</label>
                                <!--class:对应的css name:输入内容的name autofocus:加载页面时自动开启输入光标-->
                                <input id="username" type="text" class="form-control" name="username" value="" autofocus>
                                <div class="invalid-feedback" id="username-feedback"></div>
                            </div>
                            <div class="form-group">
                                <label for="password">密码</label><!--data-eye是自定义属性-->
                                <input id="password" type="password" class="form-control" name="password" data-eye>
                                <div class="invalid-feedback" id="password-feedback"></div>
                                {% for message in get_flashed_messages() %}
                                    <div class="alert">{{ message }}</div>
                                {% endfor %}
                            </div>

                            <div class="form-group m-0">
                                <button type="submit" class="btn btn-primary btn-block">
                                    登录
                                </button>
                            </div>
                            <div class="mt-4 text-center">
                                还没有账户? <a href="{{ url_for('register') }}">马上加入</a>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="footer">
                    Copyright &copy; 2020 &mdash; todo.NUTURE
                </div>
            </div>
        </div>
    </div>
</section>
<script src="static/js/login.js"></script>
{% endblock %}